package com.cmsr.springclond.common;


/**
 * 
 * <description></description>
 * @project panda-framework
 * @author Johnny Liu
 * @date 2020-7-30
 *
 */
public class ResponseFaild extends ResponseBase {

	private Object result;

	public ResponseFaild() {
		super(ResponseBase.FAILD_STATUS, ResponseBase.FAILD_MSG);
	}

	public ResponseFaild(String msg) {
		super(ResponseBase.FAILD_STATUS, msg);
	}
	
	public ResponseFaild(Exception e) {
		super(ResponseBase.FAILD_STATUS, e.getMessage());
	}
	public ResponseFaild(String status, String message) {
		super(status, message);
	}
	@Override
	public String toString() {
		return "ResponseSuccess [ " + super.toString() + " ]";
	}
	
	public static ResponseFaild failure(String code, String msg) {
		ResponseFaild result =new ResponseFaild(code,msg);
		return result;
	}
	
	
	public static ResponseFaild failure(String code, String msg, Object o) {
		ResponseFaild result =new ResponseFaild(code,msg);
		result.setResult(o);
		return result;
	}
	public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

	public static ResponseFaild failure(String code) {
		ResponseFaild result =new ResponseFaild(code);
		return result;
	}


}
